package com.yf.mediaserver.zlm;

import cn.hutool.http.Method;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 文档对照{@link  <a href="https://github.com/ZLMediaKit/ZLMediaKit/blob/master/server/WebApi.cpp#L261">...</a>}
 */
@AllArgsConstructor
@Getter
public enum APIEnum {
    /**
     * param: 无
     */
    GET_API_LIST("/index/api/getApiList", Method.GET, "获取服务器API列表"),
    /**
     *param:load,delay,data
     */
    GET_THREADS_LOAD("/index/api/getThreadsLoad", Method.GET, "获取网络线程负载"),
    /**
     * param: 无
     */
    GET_STATISTIC("/index/api/getStatistic", Method.GET, "得到主要对象个数"),
    /**
     *param:load,delay,data
     */
    GET_WORK_THREADS_LOAD("/index/api/getWorkThreadsLoad", Method.GET, "得到后台线程负载"),
    /**
     * param: 无
     */
    GET_SERVER_CONFIG("/index/api/getServerConfig", Method.GET, "得到服务器配置"),
    /**
     * param: 根据配置文件指定
     */
    SET_SERVER_CONFIG("/index/api/setServerConfig", Method.POST, "设置服务器配置"),
    /**
     * param:无
     */
    RESTART_SERVER("/index/api/restartServer", Method.GET, "重启服务"),
    /**
     *param:app,stream,schema,vhost
     */
    GET_MEDIA_LIST("/index/api/getMediaList", Method.GET, "得到流列表"),
    /**
     *param:app,stream,schema,vhost
     */
    GET_MEDIA_INFO("/index/api/getMediaInfo", Method.GET, "GET_MEDIA_INFO"),
    /**
     *param:app,stream,schema,vhost
     */
    CLOSE_STREAM("/index/api/close_stream", Method.GET, "关闭流"),
    /**
     *param:app,stream,schema,vhost,count_hit,count_closed
     */
    CLOSE_STREAMS("/index/api/close_streams", Method.GET, "批量关闭流"),
    /**
     *param:local_port,peer_ip
     */
    GET_ALL_SESSION("/index/api/getAllSession", Method.GET, "获取session列表"),
    /**
     *param:id
     */
    KICK_SESSION("/index/api/kick_session", Method.GET, "断开tcp连接"),
    /**
     *param:local_port,peer_ip
     */
    KICK_SESSIONS("/index/api/kick_sessions", Method.GET, "KICK_SESSIONS"),
    /**
     *param:app,stream,schema,vhost,dst_url,retry_count,timeout_sec,rtp_type
     */
    ADD_STREAM_PUSHER_PROXY("/index/api/addStreamPusherProxy", Method.GET, "ADD_STREAM_PUSHER_PROXY"),
    /**
     *param:app,stream,schema,vhost,dst_url,retry_count,timeout_sec,rtp_type
     */
    ADD_STREAM_PROXY("/index/api/addStreamProxy", Method.GET, "添加流代理"),
    /**
     *param:key
     */
    DEL_STREAM_PUSHER_PROXY("/index/api/delStreamPusherProxy", Method.GET, "关闭拉流代理"),
    /**
     *param:type,vhost,app,stream,schema
     */
    START_RECORD("/index/api/startRecord", Method.GET, "开始录制"),
    /**
     *param:vhost,app,stream,schema,speed
     */
    SET_RECORD_SPEED("/index/api/setRecordSpeed", Method.GET, "设置录像速度"),
    /**
     *param:vhost,app,stream,schema,stamp
     */
    SEEK_RECORD_STAMP("/index/api/seekRecordStamp", Method.GET, "设置录像流播放位置"),
    /**
     *param:type,vhost,app,stream
     */
    STOP_RECORD("/index/api/stopRecord", Method.GET, "停止录制"),
    /**
     *param:type,vhost,app,stream
     */
    IS_RECORDING("/index/api/isRecording", Method.GET, "是否正在录制"),
    /**
     * param: url,timeout_sec,expire_sec
     */
    GET_SNAP("/index/api/getSnap", Method.GET, "获取截图"),
    /**
     * param:stream_id
     */
    GET_RTP_INFO("/index/api/getRtpInfo", Method.GET, "得到RTP推流信息"),
    /**
     * param:stream_id,port,tcp_mode,enable_tcp,ssrc,re_use_port,only_audio
     */
    OPEN_RTP_SERVER("/index/api/openRtpServer", Method.GET, "创建多路复用的RTP服务器"),
    /**
     * param:stream_id,port,tcp_mode,enable_tcp,ssrc,re_use_port,only_audio
     */
    OPEN_RTP_SERVER_MULTIPLEX("/index/api/openRtpServerMultiplex", Method.GET, "OPEN_RTP_SERVER_MULTIPLEX"),
    /**
     * param:stream_id, dst_url, dst_port
     */
    CONNECT_RTP_SERVER("/index/api/connectRtpServer", Method.GET, "连接RTP服务器"),
    /**
     * param:stream_id
     */
    CLOSE_RTP_SERVER("/index/api/closeRtpServer", Method.GET, "关闭RTP服务器"),
    /**
     * param:stream_id,ssrc
     */
    UPDATE_RTP_SERVER_SSRC("/index/api/updateRtpServerSSRC", Method.GET, "更新RTP服务器SSRC"),
    /**
     * param: stream_id
     */
    PAUSE_RTP_CHECK("/index/api/pauseRtpCheck", Method.GET, "暂停RTP超时检查"),
    /**
     * param: stream_id
     */
    RESUME_RTP_CHECK("/index/api/resumeRtpCheck", Method.GET, "恢复RTP超时检查"),
    /**
     * param:无
     */
    LIST_RTP_SERVER("/index/api/listRtpServer", Method.GET, "获取RTP服务列表"),
    /**
     * param:vhost, app, stream, ssrc, dst_url, dst_port, is_udp,from_mp4
     */
    START_SEND_RTP("/index/api/startSendRtp", Method.GET, "开始发送RTP"),
    /**
     * param:vhost, app, stream, ssrc, stream, from_mp4,src_port,use_ps,pt,only_audio,recv_stream_id,close_delay_ms,is_udp,passive
     */
    START_SEND_RTP_PASSIVE("/index/api/startSendRtpPassive", Method.GET, "开始TCP被动发送RTP (TCP PASSIVE) "),
    /**
     * param :vhost, app, stream
     */
    STOP_SEND_RTP("/index/api/stopSendRtp", Method.GET, "停止发送RTP"),
    /**
     * param :key
     */
    GET_PROXY_INFO("/index/api/getProxyInfo", Method.GET, "得到拉流代理信息"),
    /**
     * param :key
     */
    GET_PROXY_PUSHER_INFO("/index/api/getProxyPusherInfo", Method.GET, "得到推流代理信息"),
    /**
     * param: vhost, app, stream, file_path
     */
    LOAD_MP4_FILE("/index/api/loadMP4File", Method.GET, "点播MP4文件"),
    /**
     * param:src_url,dst_url,timeout_ms,src_url,dst_url,enable_hls,enable_mp4,ffmpeg_cmd_key
     */
    ADD_F_FMPEG_SOURCE("/index/api/addFFmpegSource", Method.GET, "ADD_F_FMPEG_SOURCE"),
    /**
     * param:vhost, app, stream, period,customized_path
     */
    DELETE_RECORD_DIRECTORY("/index/api/deleteRecordDirectory", Method.GET, "删除录像文件夹"),
    /**
     * param:key
     */
    DEL_F_FMPEG_SOURCE("/index/api/delFFmpegSource", Method.GET, "关闭拉流代理"),
    /**
     * param:key
     */
    DEL_STREAM_PROXY("/index/api/delStreamProxy", Method.GET, "关闭拉流代理"),
    /**
     * param:schema,vhost,app,stream
     */
    GET_MEDIA_PLAYER_LIST("/index/api/getMediaPlayerList", Method.GET, "GET_MEDIA_PLAYER_LIST"),
    /**
     * param:vhost,app,stream,customized_path,period
     */
    GET_MP4_RECORD_FILE("/index/api/getMP4RecordFile", Method.GET, "获取录像文件夹列表或mp4文件列表"),
    /**
     * param:schema,vhost,app,stream
     */
    IS_MEDIA_ONLINE("/index/api/isMediaOnline", Method.GET, "得到在线媒体"),
    /**
     * param: vhost, app, stream, file_path
     */
    DOWNLOAD_BIN("/index/api/downloadBin", Method.GET, "http api下载可执行程序文件接口"),
    /**
     * param: file_path
     */
    DOWNLOAD_FILE("/index/api/downloadFile", Method.GET, "DOWNLOAD_FILE"),
    /**
     * param:无
     */
    BROADCAST_MESSAGE("/index/api/broadcastMessage", Method.GET, "BROADCAST_MESSAGE"),

    DELETE_WEBRTC("/index/api/delete_webrtc", Method.GET, "DELETE_WEBRTC"),
    WEBRTC("/index/api/webrtc", Method.GET, "WEBRTC"),
    WHEP("/index/api/whep", Method.GET, "WHEP"),
    WHIP("/index/api/whip", Method.GET, "WHIP"),
    VERSION("/index/api/version", Method.GET, "获取版本信息"),
    ;


    private final String path;
    private final Method method;
    private final String description;
}
